//
//  WatchContentViewController.m
//  A段
//
//  Created by 潘君峰 on 15/4/13.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "WatchContentViewController.h"



@interface WatchContentViewController () <UIWebViewDelegate, UICollectionViewDataSource, UICollectionViewDelegate>
{
    UICollectionView *_collection;
//    UIScrollView *_scroll;
}
@property (nonatomic, retain)UIWebView *webView;
@end

@implementation WatchContentViewController
- (void)dealloc
{
    [_webString release];
    [_webView release];

    [super dealloc];
}
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self webRequest];
    
    
//    [self createConllectionView];
}

- (void)webRequest
{
//    _scroll = [[[UIScrollView alloc] initWithFrame:self.view.bounds]autorelease];
//    
//    [self.view addSubview:_scroll];
    
    
    _webView = [[[UIWebView alloc] initWithFrame:CGRectMake(0, -44, self.view.frame.size.width, self.view.frame.size.height + 180)]autorelease];
    //去掉弹簧功能
    _webView.scrollView.bounces = NO;
    [self.view addSubview:_webView];
    
    //1.创建网络请求
    NSString *urlstr = self.webString;
    NSURL *url=[NSURL URLWithString:urlstr];
    NSURLRequest *request=[NSURLRequest requestWithURL:url];
    //自适应尺寸
    self.webView.scalesPageToFit=YES;
    
    //加载网络请求
    [_webView loadRequest:request];
}

//- (void)createConllectionView
//{
//    UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc] init];
//    flow.itemSize = CGSizeMake(self.view.frame.size.width, self.view.frame.size.height);
//    UICollectionView *collection = [[[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) collectionViewLayout:flow]autorelease];
////    [collection registerClass:[UICollectionReusableView class] forCellWithReuseIdentifier:@"cell"];
//    collection.delegate = self;
//    collection.dataSource = self;
//    [self.view addSubview:collection];
//    
//}
//
//- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
//{
//    return 10;
//}
//
////- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
////{
////    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
////    
////    
////    return cell;
////}


















@end
